<!DESCRIPTION> JavaScript can sort data based on any field of information. In this example, a checkbook register can be sorted by date, check number, check amount, or paid to person.
<!/DESCRIPTION>
<!CATEGORY>Messages<!/CATEGORY>
<!SCRIPT>
<!-- START OF SCRIPT -->
<!-- HOW TO INSTALL CHECK SORTER:
1. Copy code into the HEAD section of document
2. Put last coding into the BODY section of document -->
<!-- STEP ONE: Add code into HEAD section of document -->
<SCRIPT LANGUAGE="JavaScript">
<!-- Original: Tom Folkes (tfolkes@cpcug.org) -->
<!-- Begin
function dates(datea,dateb){
var yeara = 1 * datea.substring(6,8);
var yearb = 1 * dateb.substring(6,8);
if (yeara > yearb) return true;
if (yeara < yearb) return false;
var montha = 1 * datea.substring(0,2);
var monthb = 1 * dateb.substring(0,2);
if (montha > monthb) return true;
if (montha < monthb) return false;
var daya = 1 * datea.substring(3,5);
var dayb = 1 * dateb.substring(3,5);
if (daya > dayb) return true;
return false;
}
function exchange(i,form){
/* This function swaps the information in the various cells */